/* 遮罩层 */
.yinliai-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 2147483646;
  display: none;
}

.yinliai-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 560px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  z-index: 2147483647;
  display: none;
}

.yinliai-dialog-header {
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.yinliai-dialog-title {
  font-size: 16px;
  color: #333;
}

.yinliai-dialog-close {
  cursor: pointer;
  padding: 4px;
  color: #999;
  font-size: 18px;
  line-height: 1;
}

.yinliai-dialog-content {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
  width: 100%;
}

.yinliai-dialog-input-section {
  position: relative;
  width: 99%;
}

.yinliai-dialog-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  resize: none;
  min-height: 100px;
  font-size: 14px;
  color: #333;
  transition: all 0.2s;
}

.yinliai-dialog-input:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.yinliai-dialog-middle-section {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
}

.yinliai-dialog-bottom-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid #E5E7EB;
}

.option-item {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  cursor: pointer;
  color: #333;
  font-size: 14px;
  transition: all 0.2s;
  background: white;
}

.option-item:hover {
  background: #F9FAFB;
  border-color: #D1D5DB;
}

.visit-kimi {
  color: #2563EB;
  border-color: #2563EB;
}

.visit-kimi:hover {
  background: rgba(37, 99, 235, 0.05);
  border-color: #2563EB;
}

.bottom-right {
  display: flex;
  gap: 12px;
}

.shortcut-key {
  color: #6B7280;
  font-size: 12px;
  padding: 4px 8px;
  background: #F3F4F6;
  border-radius: 4px;
}

.yinliai-dialog-input::placeholder {
  color: #9CA3AF;
}

.dialog-icon {
  width: 24px;
  height: 24px;
}

.option-icon {
  width: 20px;
  height: 20px;
}

/* 侧边栏样式 */
.yinliai-dialog.sidebar {
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  transform: none;
  width: 380px;
  height: 100vh;
  border-radius: 0;
  animation: slideIn 0.3s ease-out;
}

/* 侧边栏动画 */
@keyframes slideIn {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

/* 调整侧边栏模式下的内部布局 */
.sidebar .yinliai-dialog-content {
  height: calc(100vh - 64px); /* 减去header高度 */
  display: flex;
  flex-direction: column;
}

.sidebar .yinliai-dialog-input-section {
  flex: 0 0 auto;
}

.sidebar .yinliai-dialog-middle-section {
  flex: 1;
  margin: 16px 0;
}

.sidebar .yinliai-dialog-bottom-section {
  flex: 0 0 auto;
}

/* 响应遮罩层 */
.response-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 2147483646;
}

.yinliai-response-container {
  position: fixed;
  z-index: 2147483647;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  width: 800px; /* 增加宽度 */
  max-width: 90vw;
  max-height: 90vh; /* 增加高度 */
  display: flex;
  flex-direction: column;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.response-content-area {
  flex: 1;
  padding: 24px; /* 增加内边距 */
  overflow-y: auto;
  min-height: 300px; /* 增加最小高度 */
  max-height: calc(90vh - 120px);
}

.response-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.response-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.response-close {
  font-size: 24px;
  color: #999;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.response-close:hover {
  background: #f5f5f5;
  color: #666;
}

.response-avatar {
  width: 28px; /* 增加头像尺寸 */
  height: 28px;
  border-radius: 50%;
}

.response-name {
  font-size: 15px;
  font-weight: 500;
  color: #333;
}

.response-content {
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  padding: 0 10px;
  overflow-y: auto;
}

.response-input-area {
  border-top: 1px solid #E5E7EB;
  padding: 20px 24px; /* 增加内边距 */
  display: flex;
  gap: 12px;
  background: #fff;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.response-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  resize: none;
  height: 44px; /* 增加输入框高度 */
  font-size: 14px;
  color: #333;
  transition: all 0.2s;
}

.response-send-button {
  padding: 8px 16px;
  background: #2563EB;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.response-send-button:hover {
  background: #1D4ED8;
}

/* 摘要内容样式 */
.summary-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.summary-section h3 {
  font-size: 16px;
  font-weight: 500;
  margin: 0;
  color: #111;
}

.summary-section p {
  margin: 0;
  color: #333;
}

.summary-section ul {
  margin: 0;
  padding-left: 20px;
}

.summary-section li {
  margin-bottom: 8px;
}

.chat-message {
  margin: 16px 0;
  display: flex;
  flex-direction: column;
}

.chat-message.user {
  align-items: flex-end;
}

.chat-message.ai {
  align-items: flex-start;
}

.message-content {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 12px;
  position: relative;
  margin: 4px 0;
}

.user .message-content {
  background: #2563EB;
  color: white;
  border-top-right-radius: 4px;
}

.ai .message-content {
  background: #F3F4F6;
  color: #333;
  border-top-left-radius: 4px;
}

.message-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}

.chat-message:hover .message-actions {
  opacity: 1;
}

.action-button {
  font-size: 13px;
  color: #666;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.action-button:hover {
  background: #F3F4F6;
  color: #2563EB;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  align-items: center;
  min-height: 24px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: #999;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* 登录提示样式 */
.login-reminder {
  text-align: center;
  padding: 20px;
  color: #666;
}

.login-reminder p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.message-content.error {
  color: #DC2626;
  background: #FEE2E2;
}

.dialog-send-button {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 6px 16px;
  background: #2563EB;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.dialog-send-button:hover {
  background: #1D4ED8;
}

.dialog-send-button:disabled {
  background: #93C5FD;
  cursor: not-allowed;
}

/* Markdown 样式 */
.message-content {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
}

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
  margin: 16px 0 8px;
  font-weight: 600;
  line-height: 1.25;
}

.message-content h1 { font-size: 1.5em; }
.message-content h2 { font-size: 1.3em; }
.message-content h3 { font-size: 1.2em; }
.message-content h4 { font-size: 1.1em; }

.message-content p {
  margin: 8px 0;
}

.message-content code {
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 85%;
  background-color: rgba(27, 31, 35, 0.05);
  border-radius: 3px;
  padding: 0.2em 0.4em;
}

.message-content pre {
  background-color: #f6f8fa;
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  margin: 8px 0;
}

.message-content pre code {
  background: none;
  padding: 0;
  font-size: 100%;
}

.message-content ul,
.message-content ol {
  margin: 8px 0;
  padding-left: 24px;
}

.message-content li {
  margin: 4px 0;
}

.message-content blockquote {
  margin: 8px 0;
  padding-left: 12px;
  border-left: 4px solid #ddd;
  color: #666;
}

.message-content img {
  max-width: 100%;
  border-radius: 4px;
}

.message-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 8px 0;
}

.message-content th,
.message-content td {
  padding: 6px 12px;
  border: 1px solid #ddd;
}

.message-content th {
  background-color: #f6f8fa;
}

.message-content a {
  color: #2563EB;
  text-decoration: none;
}

.message-content a:hover {
  text-decoration: underline;
}

/* 全局遮罩层 */
.global-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 2147483646;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.global-overlay.show {
  display: block;
  opacity: 1;
}

/* 第一层弹窗 */
.yinliai-dialog.global-window {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 560px;
  max-width: 90vw;
  max-height: 80vh;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  z-index: 2147483647;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s ease;
}

.yinliai-dialog.global-window.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

/* 第二层弹窗 */
.response-container.global-window {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 680px;
  max-width: 90vw;
  height: 80vh;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  z-index: 2147483647;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s ease;
}

.response-container.global-window.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
} 